﻿using DevExpress.XtraEditors;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Windows.Forms;

namespace HRM.CORE
{
    public class xfmLoginMail : XtraForm
    {
        public delegate void LoginHandler(object sender, string Email, string Password);
        private IContainer icontainer_0 = null;
        private GroupControl groupControl_0;
        private TextEdit textEdit_0;
        private LabelControl labelControl_0;
        private LabelControl labelControl_1;
        private TextEdit textEdit_1;
        private SimpleButton simpleButton_0;
        private SimpleButton simpleButton_1;
        private xfmLoginMail.LoginHandler loginHandler_0;
        public event xfmLoginMail.LoginHandler Login
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            add
            {
                this.loginHandler_0 = (xfmLoginMail.LoginHandler)Delegate.Combine(this.loginHandler_0, value);
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            remove
            {
                this.loginHandler_0 = (xfmLoginMail.LoginHandler)Delegate.Remove(this.loginHandler_0, value);
            }
        }
        protected override void Dispose(bool disposing)
        {
            if (disposing && this.icontainer_0 != null)
            {
                this.icontainer_0.Dispose();
            }
            base.Dispose(disposing);
        }
        private void method_0()
        {
            ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(xfmLoginMail));
            this.groupControl_0 = new GroupControl();
            this.labelControl_0 = new LabelControl();
            this.labelControl_1 = new LabelControl();
            this.textEdit_1 = new TextEdit();
            this.textEdit_0 = new TextEdit();
            this.simpleButton_0 = new SimpleButton();
            this.simpleButton_1 = new SimpleButton();
            ((ISupportInitialize)this.groupControl_0).BeginInit();
            this.groupControl_0.SuspendLayout();
            ((ISupportInitialize)this.textEdit_1.Properties).BeginInit();
            ((ISupportInitialize)this.textEdit_0.Properties).BeginInit();
            base.SuspendLayout();
            this.groupControl_0.Controls.Add(this.labelControl_0);
            this.groupControl_0.Controls.Add(this.labelControl_1);
            this.groupControl_0.Controls.Add(this.textEdit_1);
            this.groupControl_0.Controls.Add(this.textEdit_0);
            this.groupControl_0.Dock = DockStyle.Top;
            this.groupControl_0.Location = new Point(0, 0);
            this.groupControl_0.Name = "groupControl1";
            this.groupControl_0.Size = new Size(307, 96);
            this.groupControl_0.TabIndex = 0;
            this.groupControl_0.Text = ">> Thông Tin";
            this.labelControl_0.AllowHtmlString = true;
            this.labelControl_0.Location = new Point(12, 65);
            this.labelControl_0.Name = "labelControl2";
            this.labelControl_0.Size = new Size(65, 14);
            this.labelControl_0.TabIndex = 3;
            this.labelControl_0.Text = "Mật khẩu <color=red>(*)</color>:";
            this.labelControl_1.AllowHtmlString = true;
            this.labelControl_1.Location = new Point(12, 36);
            this.labelControl_1.Name = "labelControl1";
            this.labelControl_1.Size = new Size(67, 14);
            this.labelControl_1.TabIndex = 2;
            this.labelControl_1.Text = "Tài khoản <color=red>(*)</color>:";
            this.textEdit_1.Location = new Point(81, 63);
            this.textEdit_1.Name = "txtPassword";
            this.textEdit_1.Properties.PasswordChar = '*';
            this.textEdit_1.Size = new Size(213, 20);
            this.textEdit_1.TabIndex = 1;
            this.textEdit_1.KeyDown += new KeyEventHandler(this.textEdit_1_KeyDown);
            this.textEdit_0.Location = new Point(81, 34);
            this.textEdit_0.Name = "txtEmail";
            this.textEdit_0.Size = new Size(213, 20);
            this.textEdit_0.TabIndex = 0;
            this.simpleButton_0.Image = (Image)componentResourceManager.GetObject("btOK.Image");
            this.simpleButton_0.Location = new Point(121, 109);
            this.simpleButton_0.Name = "btOK";
            this.simpleButton_0.Size = new Size(83, 22);
            this.simpleButton_0.TabIndex = 32;
            this.simpleButton_0.Text = "Đồng ý >>";
            this.simpleButton_0.Click += new EventHandler(this.simpleButton_0_Click);
            this.simpleButton_1.Image = (Image)componentResourceManager.GetObject("btCancel.Image");
            this.simpleButton_1.Location = new Point(211, 109);
            this.simpleButton_1.Name = "btCancel";
            this.simpleButton_1.Size = new Size(83, 22);
            this.simpleButton_1.TabIndex = 33;
            this.simpleButton_1.Text = "Kết Thúc";
            this.simpleButton_1.Click += new EventHandler(this.simpleButton_1_Click);
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(307, 140);
            base.Controls.Add(this.simpleButton_1);
            base.Controls.Add(this.simpleButton_0);
            base.Controls.Add(this.groupControl_0);
            base.FormBorderStyle = FormBorderStyle.FixedSingle;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "xfmLoginMail";
            base.ShowIcon = false;
            base.ShowInTaskbar = false;
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "Đăng Nhập Vào Tài Khoản Email Cá Nhân";
            ((ISupportInitialize)this.groupControl_0).EndInit();
            this.groupControl_0.ResumeLayout(false);
            this.groupControl_0.PerformLayout();
            ((ISupportInitialize)this.textEdit_1.Properties).EndInit();
            ((ISupportInitialize)this.textEdit_0.Properties).EndInit();
            base.ResumeLayout(false);
        }
        private void method_1(string string_0, string string_1)
        {
            if (this.loginHandler_0 != null)
            {
                this.loginHandler_0(this, string_0, string_1);
            }
        }
        public xfmLoginMail()
        {
            this.method_0();
        }
        public xfmLoginMail(string Email)
        {
            this.method_0();
            this.textEdit_0.Text = Email;
        }
        private void simpleButton_0_Click(object sender, EventArgs e)
        {
            this.method_1(this.textEdit_0.Text, this.textEdit_1.Text);
        }
        private void textEdit_1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return && this.textEdit_0.Text != "")
            {
                this.method_1(this.textEdit_0.Text, this.textEdit_1.Text);
            }
        }
        private void simpleButton_1_Click(object sender, EventArgs e)
        {
            base.Close();
        }
    }
}
